package com.wfh.ai;


import com.wfh.ai.model.HtmlCodeResult;
import com.wfh.ai.model.MultiFileCodeResult;
import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.TokenStream;
import dev.langchain4j.service.UserMessage;
import reactor.core.publisher.Flux;

/**
 * @Title: AiGenService
 * @Author wangfenghuan
 * @Package com.wfh.aigenerator.ai
 * @Date 2025/7/29 20:10
 * @description:
 */
public interface AiGenService {

    /**
     * 生成代码html
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "/prompt/system-message-html.txt")
    HtmlCodeResult genCodeWithHtml(String userMessage);

    /**
     * 生成代码html，流返回
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "/prompt/system-message-html.txt")
    Flux<String> genCodeWithHtmlStream(String userMessage);

    /**
     * 生成代码多文件
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "/prompt/system-message-multi.txt")
    MultiFileCodeResult genCodeWithMultiFile(String userMessage);

    /**
     * 生成代码多文件，流返回
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "/prompt/system-message-multi.txt")
    Flux<String> genCodeWithMultiFileStream(String userMessage);

    /**
     * 生成vue项目，流返回
     * @param userMessage
     * @param appId
     * @return
     */
    @SystemMessage(fromResource = "/prompt/system-message-vue.txt")
    TokenStream genCodeWithVueStream(@MemoryId Long appId, @UserMessage String userMessage);
}
